package com.jiazhong.boot.exception.controller;

import com.jiazhong.boot.commons.util.JsonResult;
import com.jiazhong.boot.exception.service.FirstService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/first")
public class FirstController {
    @Resource
    private FirstService service;

    @GetMapping
    public JsonResult a() {
        return service.a();
    }

    @GetMapping("/{num}")
    public JsonResult b(@PathVariable("num") int num) {
        return service.b(num);
    }

    @PostMapping("/{username}/{password}")
    public JsonResult login(@PathVariable("username") String username, @PathVariable("password") String password) {
        return service.login(username, password);
    }
}
